package kr.hkit.androidcomplete02.ch13;

import kr.hkit.androidcomplete02.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;

public class ProgressBarEx extends Activity {
	ProgressBar mProgBar;
	ProgressBar mProgCircle;
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_progressbarex);
		
		mProgBar = (ProgressBar) findViewById(R.id.ch13_progress);
		mProgCircle = (ProgressBar) findViewById(R.id.ch13_progcircle);
	}
	
	public void mOnClick(View v){
		switch(v.getId()){
		case R.id.ch13_progress_decfirst:
			mProgBar.incrementProgressBy(-2);
			break;
		case R.id.ch13_progress_incfirst:
			mProgBar.incrementProgressBy(2);
			break;
		case R.id.ch13_progress_decsecond:
			mProgBar.incrementSecondaryProgressBy(-2);
			break;
		case R.id.ch13_progress_incsecond:
			mProgBar.incrementSecondaryProgressBy(2);
			break;
		case R.id.ch13_progress_start:
			mProgCircle.setVisibility(View.VISIBLE);
			break;
		case R.id.ch13_progress_stop:
			mProgCircle.setVisibility(View.INVISIBLE);
			break;
		}
	}
}
